﻿/*
 * 公共弹出提示框
 * */
(function () {
    var lgEle = '';
        lgEle +='<div class="modal fade bs-example-modal-sm tac" id="alertKe" tabindex="-1" role="dialog"  aria-labelledby="mySmallModalLabel" aria-hidden="true" style="    text-align: center;">';
        lgEle +='  <div class="modal-dialog modal-sm" style="margin-top: 12%; width: auto;max-width: 400px;min-width: 200px;display: inline-block;">';
        lgEle +='    <div class="modal-content" style="word-wrap: break-word;word-break: normal;">';
        lgEle +='      <h3 class="text-center" style="margin:20px;"><p><small style="padding:0 20px;line-height:24px;" id="dialog_msg" class="flex-center"></small></p></h3>';
        lgEle +='    </div>';
        lgEle +='  </div>';
        lgEle +='</div>';

    $('body').append(lgEle);
})();

// msg: 提示内容；callback: 回调形参
var dialogKe = function(msg, callback) {
	var timer = null;
	$('#dialog_msg').html('<i class="icon-warning-sign"></i> '+msg);
	$('#alertKe').modal('show');
	
	clearTimeout(timer);
	timer = setTimeout(function() {
		$('#alertKe').modal('hide');
		if(typeof(callback) == 'function') callback();
	}, 5000);
	
}
var dialogKes = function(msg, callback,time) {
	var timer = null;
	$('#dialog_msg').html('<i class="icon-warning-sign"></i> '+msg);
	$('#alertKe').modal('show');
	
	clearTimeout(timer);
	timer = setTimeout(function() {
		$('#alertKe').modal('hide');
		if(typeof(callback) == 'function') callback();
	}, time);
}